<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<script src="<c:url value='/js/search_valid.js'/>"></script>
<div class="page-header">
	<h3 style="margin-top: auto">检索功能函数组件</h3>
	<form class="form-search" action="<%=request.getContextPath()%>/component/method_component/search"
			method="POST" onsubmit="return valid();">
		<div class="input-append"><input type="text" class="span2 search-query" id="searchText" name="searchText"
				style="width: 600px">
			<button type="submit" class="btn" ><i class="icon-plus"></i>&nbsp;检索</button>
		</div>
	</form>
</div>
<div class="row-fluid">
	<div>
		<c:choose>
			<c:when test="${!empty mylist}">
				<table class="table table-hover" style="width:90%">
					<thead>
						<tr>
							<th width="10%">编号</th>
							<th width="30%">名称</th>
							<th width="30%">实现接口</th>
							<th width="10%">版本号</th>
							<!-- <th width="30%">描述信息</th> -->
							<th width="20%">操作
								<div style="float: right;">
									<button class="btn btn-small"
										onclick="window.location.href='<%=request.getContextPath()%>/component/method_component/add';"><i class="icon-plus"></i>&nbsp;创建新组件</button>
								</div>
							</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${mylist}" var="list" varStatus="s">
							<tr>
								<td><c:out value="${s.count}" /></td>
								<td><c:out value="${list.name}" /></td>
								<td><c:choose>
										<c:when test="${!empty list.cinterface}">
											<c:out value="${list.cinterface.name}" />
										</c:when>
									</c:choose></td>
								<td><c:out value="${list.version}" /></td>
								<%-- <td><c:out value="${list.description}" /></td> --%>
								<!--  <td><c:out value="${list.createTime.getYear()+1900}"/>-<c:out value="${list.createTime.getMonth()+1}"/>-<c:out value="${list.createTime.getDate()}"/></td>
                  <td><c:out value="${list.owner.username}"/></td>-->
								<td><c:set var="muri" value="${fn:replace(list.uri,':', '/')}" />
								<div class="btn-group">
										<button class="btn" onclick="window.location.href='<%=request.getContextPath()%>/${muri}/update';"><i class="icon-edit"></i>&nbsp;编辑</button>
										<button class="btn"
											onclick="window.location.href='<%=request.getContextPath()%>/${muri}/download';"><i class="icon-download"></i>&nbsp;下载</button>
										<button class="btn"
											onclick="window.location.href='<%=request.getContextPath()%>/${muri}';"><i class="icon-search"></i>&nbsp;详细信息</button>
									</div></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</c:when>
			<c:otherwise>
				<h3 style="margin-top: auto">数据库暂无相关功能函数组件</h3>
			</c:otherwise>
		</c:choose>
	</div>

	<!-- <form action="<%=request.getContextPath()%>/method_component/download/429" method="POST">
          <input type= "submit" class="btn" value="下载"/>
          </form> -->
</div>
<!--/row-->